UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2sbTp3T1c/8D+XV3RLBkRyRvoZouyJHpQAQFwh5wuRM='
WHERE
key_id = '3e68d34377d4f0857852035ed9a4cf05330bbcba03233690cf23296ba39d0134'
AND (
token = '2sbTp3T1c/8D+XV3RLBkRyRvoZouyJHpQAQFwh5wuRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)