UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'usjzzrAq1CkFcQehBNb/aypDf1siHaoPUeiVZ6jVZFg=' 
WHERE 
  key_id = '9db65a6460a987ee6ba1191184252c58dfe5c964be310f969d6717fa2636163e' 
  AND (
    token = 'usjzzrAq1CkFcQehBNb/aypDf1siHaoPUeiVZ6jVZFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021