UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2IFr+oNTmAx/iEej7tzZeI/UyBj6LBww71y8boihGfw='
WHERE
key_id = '4643f7ec526ff0010d986381e135ce5a9ba527522d77a530cd6cdbaeff4f6d94'
AND (
token = '2IFr+oNTmAx/iEej7tzZeI/UyBj6LBww71y8boihGfw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)