UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GR0Tb1qpgLwb78ngCqlzZ0AHgLmJrSyHnXiSD7zgkpU=' 
WHERE 
  key_id = '3cfab445ab8913d41aec437f1f99b9e02dfc08a92ad0b70bb7869b1b286415ba' 
  AND (
    token = 'GR0Tb1qpgLwb78ngCqlzZ0AHgLmJrSyHnXiSD7zgkpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030