UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f4kM7UTWhWbUVopjot8oPNPV5T16okNz3I/lvuaw2dc='
WHERE
key_id = '976b8d3a6b70b511627b71c518daad1ab0f2f16d3cca47df6890cf6b3c20ec70'
AND (
token = 'f4kM7UTWhWbUVopjot8oPNPV5T16okNz3I/lvuaw2dc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)