UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LJW4QoE3g3K17QgIHCVjUD64jYq6tI9vmS4siovJxto='
WHERE
key_id = '278867267cf599ee1faeccdf778d88854fb6ffa442f4c98a572a966117ebc359'
AND (
token = 'LJW4QoE3g3K17QgIHCVjUD64jYq6tI9vmS4siovJxto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)