UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KjbZ+95hJgOj1eRG/YoWYp0eQBCgzUuR0wER1lRsfek='
WHERE
key_id = 'b20648aa3d1d02b6908db3fb3ec646b0c7a347775048422897607f1c985abebb'
AND (
token = 'KjbZ+95hJgOj1eRG/YoWYp0eQBCgzUuR0wER1lRsfek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)