UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WOpxs11BrUIkznYDIsXu9jar1kce0andSOiatmgs1Hc=' 
WHERE 
  key_id = '07de289453a396985e095544303840e80e88cb9e49a576262ea05eb496398a91' 
  AND (
    token = 'WOpxs11BrUIkznYDIsXu9jar1kce0andSOiatmgs1Hc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033