UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+BLUQCAfSWVZ26mooxn3qbriD/SrunIbCqg2+PmRZbw=' 
WHERE 
  key_id = '1e6e8a58f8f7c984d06dd04c4c348634f573e123fc1f9405c660638a71a4f48b' 
  AND (
    token = '+BLUQCAfSWVZ26mooxn3qbriD/SrunIbCqg2+PmRZbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035