UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u/ltg5Mk3Ab3jUxDOOurTIp6iG6512tysenlGuwTn8s=' 
WHERE 
  key_id = 'a42f73570803dcb24a9301b3ff3f2a62b2659a1123af6f0fc8cf1545fb1db256' 
  AND (
    token = 'u/ltg5Mk3Ab3jUxDOOurTIp6iG6512tysenlGuwTn8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044