UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8DDNcLvhK4i/ljaba8qj1ccz5BPEDLZuiUM586cdOf0=' 
WHERE 
  key_id = 'dd826f43f6bb4bb3ec88157cab4adae5aefdc3ce6b2bbe8fa61d2b299bfe40b9' 
  AND (
    token = '8DDNcLvhK4i/ljaba8qj1ccz5BPEDLZuiUM586cdOf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030