UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sAtFGRAD/hkYlj6IvjAbS/piQMSRItPiV19y2yQecAY='
WHERE
key_id = 'a72d68e716a1f7caa0ff104dd60c2dc3ee3cd6f338ef88e574bc74f479d51bf1'
AND (
token = 'sAtFGRAD/hkYlj6IvjAbS/piQMSRItPiV19y2yQecAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)