UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ituDW54oYB9R0Uk0xIJxdOh34pZQb0McScolaU+/gGs=' 
WHERE 
  key_id = 'e26b85ed4d5fb0c2bda5899fb1713b67fabe30f4dd991e13d2325fae695e5e78' 
  AND (
    token = 'ituDW54oYB9R0Uk0xIJxdOh34pZQb0McScolaU+/gGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036