UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JEtcuQqTXgmr0n7s+HWOFcE897yNbqRH4lrBYjWvJKM='
WHERE
key_id = 'a84f58b3cea5ee5f49dcd833443c01f36ecadceb76c35088e6e4a8742f525764'
AND (
token = 'JEtcuQqTXgmr0n7s+HWOFcE897yNbqRH4lrBYjWvJKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)