UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Xxjhl3KNHEwtHQhxcO4zv71xGUon+9Igj6qjgUsG2g='
WHERE
key_id = 'bee0ff80d6178bbc0b2eaff86fad96b8ecf291d6636b9924addfd44e651dfc8a'
AND (
token = '7Xxjhl3KNHEwtHQhxcO4zv71xGUon+9Igj6qjgUsG2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)