UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CglDbip84Gk6gTRluMavsaoLgHgFYSM/hgzEu0FRfXo=' 
WHERE 
  key_id = 'c30998df97db741fa4e698a172f9e4a3229e57c4cf9dd546ccff157fcbda44b5' 
  AND (
    token = 'CglDbip84Gk6gTRluMavsaoLgHgFYSM/hgzEu0FRfXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030