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