UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zNCO9CsLSPr8g2fz01ahEXfY/ILkOFH41nPoBBcoals=' 
WHERE 
  key_id = 'b908e648d1aca21c7e1351f6d2fa1b71665cee8ca10605667906f09a75d69ef2' 
  AND (
    token = 'zNCO9CsLSPr8g2fz01ahEXfY/ILkOFH41nPoBBcoals=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066