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