UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N4YoZKiO4u7Se6IZzw5RSMGGzDobJECMQUEyy86aTcY='
WHERE
key_id = 'e1a6a84625e11a389ceaf50dee1966ea378ae78c726ede4a759474d78a41c4d9'
AND (
token = 'N4YoZKiO4u7Se6IZzw5RSMGGzDobJECMQUEyy86aTcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)