UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXKduPq9DTsWAEHwwmLAUOjEKbFB3M7NOUP+tyPRdfI=' 
WHERE 
  key_id = 'fb39afd906cae009076eb87a557685db5694f80e3a62ea74b91bba5873c627ef' 
  AND (
    token = 'QXKduPq9DTsWAEHwwmLAUOjEKbFB3M7NOUP+tyPRdfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042