UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FRmj2rYoee4VaU43dvi0sO+OJnMyTrfpai6ryNXBOQQ=' 
WHERE 
  key_id = '8c1fe7a5330a29b4f1679876d0436cf4fde9ad1362e9bc8fb63904657b60da69' 
  AND (
    token = 'FRmj2rYoee4VaU43dvi0sO+OJnMyTrfpai6ryNXBOQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032