UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IVxNNuFW9LqFVzvbuAwnY3bTgLilhhMORUrEbU0xQxM='
WHERE
key_id = '56570c5287d9d7a9f8b030f66694b2eefe429d1e33d9051a02fde51f18de9d18'
AND (
token = 'IVxNNuFW9LqFVzvbuAwnY3bTgLilhhMORUrEbU0xQxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)