UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mU4+Lc1SzZiOMMxhCTrFWZDRZcfKBwJO4vDuwJIOpLg=' 
WHERE 
  key_id = 'c7308acd97ddb887f8c8ff0d3d6e2057cbce1a8ac166a6b2d8811c01982f8193' 
  AND (
    token = 'mU4+Lc1SzZiOMMxhCTrFWZDRZcfKBwJO4vDuwJIOpLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037