UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r1cYjvxtOba+8klXztdsAN5+IqO8P7xEUtg2g6Mo6ME='
WHERE
key_id = '06aae61e17e8bd2723dd599941fb70cae99066698762715ed59170bb160ad83f'
AND (
token = 'r1cYjvxtOba+8klXztdsAN5+IqO8P7xEUtg2g6Mo6ME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)