UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AYD2Sgc2jiCn4/8f9jkzKeHkTkK2XKs+7/oSvCXpojo=' 
WHERE 
  key_id = '3d9134f712433254cc2bcef22ebdaa6b0942068dec8e1d8c3bea4de99dc4fd13' 
  AND (
    token = 'AYD2Sgc2jiCn4/8f9jkzKeHkTkK2XKs+7/oSvCXpojo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032