UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6LjOgQZUbPaEfYrx29rBgDIuMC/2z5GJa1FaxR0oZxc=' 
WHERE 
  key_id = 'a7b5b6db7bb989cf0ce36a995e056d30a45a331f1b960118a62c13c26eeb5609' 
  AND (
    token = '6LjOgQZUbPaEfYrx29rBgDIuMC/2z5GJa1FaxR0oZxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037