UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sb88/5nWRmzF9eHAwK9FDu55RUEh3nUxY4JnkZUOdOc=' 
WHERE 
  key_id = '1544afe9aee365b31adc0a323b52a99a5b627b71bee29e17940c11605a41ce5d' 
  AND (
    token = 'Sb88/5nWRmzF9eHAwK9FDu55RUEh3nUxY4JnkZUOdOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030