UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vOPjhQRnoW5Q3XhEgbRJ5J5RXx+SKqXSKEWRYtCW+6c=' 
WHERE 
  key_id = 'b294a45266e0cafce3ce16ed1bbed6f8e30bca861955e41899af776400fd5d95' 
  AND (
    token = 'vOPjhQRnoW5Q3XhEgbRJ5J5RXx+SKqXSKEWRYtCW+6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049