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