UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2sdnA36FY0MzKH5DXVSG/5OyBjWjwzHTY5h3WFkJcro=' 
WHERE 
  key_id = '2aff1589db4cc4a240b7564c005c80682ffa5fb06d4538a69a295bf56716d11d' 
  AND (
    token = '2sdnA36FY0MzKH5DXVSG/5OyBjWjwzHTY5h3WFkJcro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044