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