UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ZvKfRaocVRWFk1HESmdj7Gl5GYMAqC3kqNtQCtFzkU='
WHERE
key_id = '4e80bd2e20006405d3a3ce9a431403e470148431088065cd6b41597f0641d7af'
AND (
token = '5ZvKfRaocVRWFk1HESmdj7Gl5GYMAqC3kqNtQCtFzkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)