UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NOzgS46Rc0oYH1zPlbQ9wRfMfLu2eniBe6qeWCnYKxQ=' 
WHERE 
  key_id = '811d881bc0956de8e27b0b1530b462d3002d98613a03340936249479f34df40e' 
  AND (
    token = 'NOzgS46Rc0oYH1zPlbQ9wRfMfLu2eniBe6qeWCnYKxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022