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