UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bsMpSiXVlsfZuJ7qaP+rzcDKjvEcL1cckmcTwLhG0do='
WHERE
key_id = '7da4a6b20fa54c4b08f94be6ebe7ea3f63281f9f7156fa81bd95c6c91d0a1a5a'
AND (
token = 'bsMpSiXVlsfZuJ7qaP+rzcDKjvEcL1cckmcTwLhG0do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)