UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zh/E3Tb5x+/kjCr6Ig9QS03rhXFUEH+4883oMU0PsGI=' 
WHERE 
  key_id = '05eaec70bb64a2eabaeb802a8fe11fd0c3e91bede6bc41745ab2bd9d1ab33ad9' 
  AND (
    token = 'zh/E3Tb5x+/kjCr6Ig9QS03rhXFUEH+4883oMU0PsGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030