UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'krNnv4wd2ggiW79toHGhuKbPLcq6kKN+YM7M/hvVr3Q='
WHERE
key_id = '05871ff6f1dd3276c353ec69aa3b4c8e8c1b79fd563c489a2173ae692f89d61f'
AND (
token = 'krNnv4wd2ggiW79toHGhuKbPLcq6kKN+YM7M/hvVr3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)