UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yQbhPuZTl9S2NyNu29aeY2ypp07H+o6ImVrGgvU7kh4='
WHERE
key_id = '29338bb206f1ae1af603fb0617da36104836c389b0d94af549f92b4eddf5efb2'
AND (
token = 'yQbhPuZTl9S2NyNu29aeY2ypp07H+o6ImVrGgvU7kh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)