UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ylQQgeqzKTPetFaMxgOyNI/S3t8D+wiKXLYxJKAsQyQ='
WHERE
key_id = '2a97df5617faba3cfe64d01ec9078e80e4ba2933e2ba15820aebd31375fad1fb'
AND (
token = 'ylQQgeqzKTPetFaMxgOyNI/S3t8D+wiKXLYxJKAsQyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)