UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fZNMyWbt81wsXbe//5G7UDr8jZR8BBP7p7POXWdijkE=' 
WHERE 
  key_id = '811722659504a71b23f9d52842c51271361a9ea0a3158ee991bd2be26ab63f48' 
  AND (
    token = 'fZNMyWbt81wsXbe//5G7UDr8jZR8BBP7p7POXWdijkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034