UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yyasz/XdVhW/u3RVxNDEzR2PJRDkFhqbeOCmh1H/em4=' 
WHERE 
  key_id = '83f150741dad60cd5dbfae4c3113b79ce9827c446c50a625e25742fc2e0cce38' 
  AND (
    token = 'yyasz/XdVhW/u3RVxNDEzR2PJRDkFhqbeOCmh1H/em4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028