UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYwB+Kbz2OrK5L06RHmPXfHn5D0KBOljN/JOZE+SDG8='
WHERE
key_id = '3e2c32f121e59b14bba58cdddcf5b848a3eeab00601fe6d104bdb047280ae5ab'
AND (
token = 'JYwB+Kbz2OrK5L06RHmPXfHn5D0KBOljN/JOZE+SDG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)