UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aoTCk/wfBGTUoXUzg1frN5DQ0/x5gNOSarGOdujYQRY='
WHERE
key_id = '9902115f942890e3bce53ff142da154ebaf91fcbc50acc97e80b7bd0faad5501'
AND (
token = 'aoTCk/wfBGTUoXUzg1frN5DQ0/x5gNOSarGOdujYQRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)