UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9VeNWeN43Eyeni5Nvu6WlFENdl2vDXypG4gIPbrkjs='
WHERE
key_id = '5e7777225eb65567670ecfc21d4c611681c3ddd34d8bb3b56ceda87858803a76'
AND (
token = 's9VeNWeN43Eyeni5Nvu6WlFENdl2vDXypG4gIPbrkjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)