UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pqnrELIVEzz89zYSe/zDfuKbgIdWvij8r1MhcI4yYFg='
WHERE
key_id = '739e4f95b353a3b849e6a0c2b564771d8bc9201342dcbc27831a4c0d2581b819'
AND (
token = 'pqnrELIVEzz89zYSe/zDfuKbgIdWvij8r1MhcI4yYFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)