UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4g3by7o1605o+OmdVJLi/NefxldRabsUqjX1gvDs44E='
WHERE
key_id = '97b99bb4ff5cc6090139a29873438833501635976f54e2a2893619834cf08d21'
AND (
token = '4g3by7o1605o+OmdVJLi/NefxldRabsUqjX1gvDs44E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)