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