UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H65JubMOftNBC6IYyRw4jt/5R0q/AcMhARlZlAwDTHQ=' 
WHERE 
  key_id = 'eaa80b13ae5faabbbe6bdb1ee5a1b60f04e3e254b711c347ae6f41e483ad487c' 
  AND (
    token = 'H65JubMOftNBC6IYyRw4jt/5R0q/AcMhARlZlAwDTHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039